<?php
// @formatter:off
/**
 * @file shortcutsmenu.php
 * @author Alejandro Dario Simi
 * @date $Date: 2013-03-31 09:33:18 +0000 (Sun, 31 Mar 2013) $
 *
 * $Id: shortcutsmenu.php 60 2013-03-31 09:33:18Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0.0.2/themes/default/controlers/others/shortcutsmenu.php $
 */
// @formatter:on

global $wcGroup;
global $wcThemeAssigns;
global $wcTagsHolder;
global $wcSpecialTags;

$wcThemeAssigns["ShortcutsMenuItems"] = array();

if($wcGroup !== false) {
	$tags = array();
	foreach($wcSpecialTags as $name) {
		$tag = $wcTagsHolder->itemByName($name, $wcGroup);
		if($tag && $tag->ok() && $tag->count) {
			$tags[$tag->name] = $tag;
		}
	}
	ksort($tags);

	foreach($tags as $tag) {
		$aux = array(
			"name" => $tag->name,
			"title" => "Tag '{$tag->name}'",
			"icon" => "tags-icon.png",
			"url" => "?action=".WC_ACTION_TAG_SHOW."&group={$wcGroup->id}&tag={$tag->id}"
		);
		$wcThemeAssigns["ShortcutsMenuItems"][] = $aux;
	}
}
?>